package com.vortex.cloud.zhsw.xinyang;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author zhanglei
 */
@EnableCaching
@EnableDiscoveryClient
@ServletComponentScan(basePackages = "com.vortex")
@SpringBootApplication(scanBasePackages = "com.vortex")
@MapperScan(basePackages = {"com.vortex.**.mapper"})
@EnableScheduling
@EntityScan(basePackages = {"com.vortex.cloud.zhsw.xinyang.domain", "com.vortex.cloud.vfs.lite.export.domain"})
public class WebBootApplication {
    private static final Logger logger = LoggerFactory.getLogger(WebBootApplication.class);

    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(WebBootApplication.class, args);
        String[] activeProfiles = ctx.getEnvironment().getActiveProfiles();
        for (String profile : activeProfiles) {
            logger.error("Spring Boot 使用profile为:{}", profile);
        }
    }
}
